package com.paireach.szwolaiyun.receiver;

import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import com.paireach.szwolaiyun.activity.Activity_B;

public class StatusJumpReceiver extends BroadcastReceiver {

    private String action = "com.paireach.szwolaiyun.ACTION_JUMP";
    private String orderNumber;
//    private int statusCode;
//    private String dcDeptType;
    private Activity mContext;

    public StatusJumpReceiver(Activity mContext) {
        this.mContext=mContext;
    }

    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent.getAction().equals(action)) {
            mContext.removeStickyBroadcast(new Intent("com.paireach.szwolaiyun.ACTION_JUMP"));
            //解析数据
            Bundle bundle = intent.getExtras();
            if (bundle != null) {
                orderNumber=bundle.getString("orderCode");
                Intent broadcastJump = new Intent();
                broadcastJump.setAction("com.paireach.szwolaiyun.ACTION_JUMP_B");
                Bundle bundle1 = new Bundle();
                bundle1.putString("orderCode",orderNumber);
                broadcastJump.putExtras(bundle1);
                mContext.sendStickyBroadcast(broadcastJump);
            }
        }
    }
}
